<?php

namespace App\Http\Controllers\Admin;

use App\Models\Articles;
use App\Models\Users;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class IndexController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $customers = Users::count();
        $articles = Articles::count();

        //解析模板
        return view('Admin/Index/index', ['customers'=>$customers, 'articles'=>$articles]);
    }

    public function logout(Request $request)
    {
        $request->session()->forget('uid');
        $request->session()->forget('uname');

        return redirect('login');
    }
}
